fix: Stop sending code argument to respond_with_error, it does not accept it#23
Merged
fix: Stop sending code argument to respond_with_error, it does not accept it#23
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a method signature mismatch in the respond_with_error method by removing the code parameter that was not being accepted by the underlying implementation.
- Removed the
codeparameter fromrespond_with_errormethod signatures - Updated method calls to no longer pass the
codeargument - Updated tests to reflect the simplified error handling
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/leopard/message_wrapper.rb | Removed code parameter from respond_with_error method signature and call |
| test/lib/message_wrapper.rb | Updated test mock and test cases to match new method signature |
| examples/echo_endpoint.rb | Added new endpoint and reduced instance count (unrelated to main fix) |
Comments suppressed due to low confidence (1)
test/lib/message_wrapper.rb:69
- This test assertion expects only the error message, but the test doesn't explicitly call
respond_with_erroron line 67. The test should ensure it's testing the correct behavior by explicitly calling the method with the exception object.
assert_equal ['broken'], msg.error_args
lib/leopard/message_wrapper.rb
Outdated
| @@ -33,8 +33,8 @@ def respond(payload) | |||
| # @param code [Integer] The HTTP status code to use for the error response. | |||
There was a problem hiding this comment.
The documentation comment still references the removed code parameter. This should be removed to match the updated method signature.
Suggested change
| # @param code [Integer] The HTTP status code to use for the error response. |
This was referenced Aug 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.